<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>运算符</title>
</head>
<body>
	
</body>
	<script>
		console.log(1 + 1);   //2
		console.log(1 - 1);   //0
		// 除
		console.log(20 / 5);   //4
		// 取余
		console.log(20 % 5);   //0
		console.log(20 % 3);   //2
		console.log(5 % 4);   //1
		console.log(3 % 4);   //3
		console.log(1 + NaN);   //NaN
		
		console.log(0.1 + 0.2);
		// var num = 1 + 1;
		var num = 2;
		// num = num + 1;
		// num++;
		++num;
		console.log(num);
		var a = 1;
		++a; 
		var b = a + 1;
		console.log(b);   //3
		
		
		var c = 1;
		c++;  // c++ = 1   c = 2
		var f = c + 1;
		console.log(f);   //3
   
		var  d = 1;
		var n = d++ + ++d;
		console.log(n);  
		
		console.log(2 > 3);
		console.log(12 == '12');  //true
		console.log(12 === '12');
		console.log(12 != '12');  
		console.log(12 != 12); 
		// 逻辑与   &&
		var a = 4>2 && 2>1 ;
		console.log(a);	
		var b = 3 > 1 && 5 > 8;
		console.log(b);
		// 逻辑或  ||
		var a = 3 > 2 ||  4 > 6;
		 console.log(a);
		 var a = 1 > 2 ||  4 > 6;
		  console.log(a);
		var num = 1;
		num += 5;
		// num = num +5;
		console.log(num);
	</script>
</html>